import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
public class Test{
    public static void main(String[] args) throws FileNotFoundException {
        File src = new File("D:\\360Downloads\\Software");
        File dest = new File("D:\\360Downloads\\wpcache");
        copydir(src,dest);

    }

    private static void copydir(File src, File dest) throws FileNotFoundException {
        File[] files = src.listFiles();
        for (File file : files) {
            if(file.isFile()){
                FileInputStream fis = new FileInputStream("file");
                FileOutputStream fos = new FileOutputStream("dest,file.getName()");

            }else{
                   copydir(file,new File(dest,file.getName()));
            }
        }

    }
}
